public class Test {

    public static void main6(String[] args) {
        String s1 = "abc" + "def";
       String s2 = new String(s1);

    }
    public static void main4(String[] args) {
        long start = System.currentTimeMillis();
        StringBuffer sbf = new StringBuffer("");
        for(int i = 0; i < 10000; ++i){
            sbf.append(i);
        }
        long end = System.currentTimeMillis();
        System.out.println(end - start);
         start = System.currentTimeMillis();
        StringBuilder sbd = new StringBuilder();
        for(int i = 0; i < 10000; ++i){
            sbd.append(i);
        }
         end = System.currentTimeMillis();
        System.out.println(end - start);
    }
    public static void main3(String[] args) {
            long start = System.currentTimeMillis();
            String s = "";
            for(int i = 0; i < 10000; ++i){
                s += i;
            }
            long end = System.currentTimeMillis();
            System.out.println(end - start);
    }
    public static void main2(String[] args) {
        String s = "hello";
        s = s + " world";
        System.out.println(s);
    }
    public static void main1(String[] args) {
        String str = "";
        for (int i = 0; i < 100; i++) {
            str += i;
        }
        System.out.println(str);
    }
}
